import request from "./config";

/* 获取验证码 */
export const getCaptcha = () => request.get("/api/users/getCaptcha");

/* 校验验证码 */
export const verifyCaptcha = (captcha) =>
  request.get("/api/users/verifyCaptcha", { params: { captcha } });
/* 登录用户 */
export const login = (username, password) =>
  request.post("/api/users/login", { username, password });
/* 获取日志 */
export const getLog = (page = 1, count = 2) =>
  request.get("/api/getloginlog", { page, count });
/* 获取角色权限 */
export const getAuth = () => request.get("/api/permission/getMenuList");

//默认一次10条 页码第1页
export const getStuList = (params = { page: 1, count: 7, classes: "" }) => request.get("/api/students/getstulist", {
  params: {
    page: params.page,
    count: params.count,
    class: params.classes
  }
})
//根据学员名字搜索学员
export const searchStu = (page = 1, count = 7, key = "") => request.get("/api/students/searchstu", {
  params: {
    page,
    count,
    key
  }
})
/* 删除学员 */
export const delStu = sId => request.get('/api/students/delstu', { params: { sId } })
/* 添加学员 */
export const addStu = (info) => request.post('/api/students/addstu', info)
/* 修改学员 */
export const updateStu = info => request.post('/api/students/updatestu', info)


//获取任务数据
export const getTarskData = () => request.get("/data/tarsk.json")
//获取rate数据
export const getRateData = () => request.get("/data/rate.json")
//获取expect数据
export const getExpectData = () => request.get("/data/expect.json")

/* 获取天气 */
export const getWeather = () => request.get('/api/weather/getWeather')



